﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using BOM.entity;

namespace BOM.dao
{
    class ParamNew
    {
        //根据fid查询数据
        public static DataTable SelectParamfid(int fid)
        {
            string cmdText = "select * from param where fid = " + fid + "";
            DataTable table = DbService.getSQLTable(cmdText, "param");
            if (table.Rows.Count > 0)
            {
                return table;
            }
            else
            {
                return null;
            }
        }
        //根据fid修改数据
        public static bool UpdateParamfna(int fid)
        {
            Paramsurface param = new Paramsurface();
            string cmdText = "update Param set fnumber = '" + param.Fnumber + "',fname = '" + param.Fname + "',fvalue = " + param.Fvalue + " where fnumber = '" + param.Fnumber + "' and fname = '" + param.Fname + "'";
            int i = DbService.executeSQL(cmdText);
            if (i == 1)
            {
                return true;
            }
            else
            {
                return false;
            }
        }
        //查询表param的所有数据
        public static DataTable SelectParam()
        {
            string cmdText = "select * from param";
            DataTable table = DbService.getSQLTable(cmdText, "param");
            if (table.Rows.Count > 0)
            {
                return table;
            }
            else
            {
                return null;
            }
        }

    }
}
